﻿using System;
using System.ServiceModel;
using Sern.Abstracts.Tracker.DataContracts;

namespace Sern.Abstracts.Tracker.ServiceContracts
{
    /// <summary>
    /// This is on a seperate interface so that you can use a different binding on it.
    /// </summary>
    [ServiceContract]
    public interface ITrackerTelemetryReceiver
    {
        /// <summary>
        /// Used to track that a given client is in the middle of working.
        /// </summary>
        /// <param name="clientId"></param>
        /// <param name="jobId"></param>
        /// <param name="previousKey"></param>
        [OperationContract(Name = "NotifyProcessing", IsOneWay = true)]        
        void Notify(ProcessingNotice notice);

        /// <summary>
        /// Used to notify that the job is ending. When either all processing has been completed, or... a time out value occur,
        /// then notify all the services eg. filter etc. to reset its streaminsight, aka, send a retract edge.
        /// </summary>
        /// <param name="jobId"></param>
        /// <param name="clientId"></param>
        /// <param name="previousKey"></param>
        [OperationContract(Name = "NotifyEnd", IsOneWay = true)]        
        void NotifyEnd(Guid jobId);



        /// <summary>
        /// Notify that the client is alive (not necessarily processing).
        /// </summary>
        /// <param name="clientId"></param>
        [OperationContract(Name = "NotifyIsAlive", IsOneWay = true)]
        void Notify(IsAliveNotice notice);
    }
}
